<template>
  <el-table
    :data="goodlist"
    style="width: 100%">
    <el-table-column
      prop="id"
      label="编号"
      width="100">
    </el-table-column>
    <el-table-column
      prop="gname"
      label="商品名称"
      width="100">
    </el-table-column>
    <el-table-column
      prop="gprice"
      label="商品单价"
      width="100">
    </el-table-column>
    <el-table-column
      prop="gdan"
      label="单位"
      width="100">
    </el-table-column>
    <el-table-column
      prop="kucun"
      label="库存"
      width="100">
    </el-table-column>
  </el-table>
</template>

<script>
    export default {
        name: "CaiList",
      data(){
          return{
            good:{},
            goodlist:[],
          }
      },
      methods:{
          search:function () {
              this.$http.get("/good/goodlist").then(
                (res)=>{
                  if(res.data.success){
                    this.goodlist=res.data.result;
                  }else{
                    this.$message.error(res.data.message);
                  }
                }
              );

          }
      },
      mounted() {
          this.search();
      }
    }
</script>

<style scoped>

</style>
